Skip to content

feat(core): Deprecate Span.setHttpStatus in favor of setHttpStatus #10268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 29, 2024

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Jan 19, 2024

This PR deprecates the last remaining otel-incompatible API on the Span class and interface - Span.setHttpStatus.

We replace this functionality with a setHttpStatus wrapper because in addition to setting the data/tag value (more on that below), this function also derives the span status from the status code. Added tests to make sure this is covered properly (I think it wasn't covered well before and we need to remove the old tests anyway).

I checked with the ingest team and theoretically, from a Relay PoV, we could stop sending the http.status_code tag right now. Our min supported Relay version already primarily expectes the http.response.status_code data property and only falls back to the tag. However: After giving this more thought, I opted to leave the payload unchanged for now because users can theoretically depend on the presence of the tag or data in beforeSendTransaction. So to avoid breaking user-added behaviour, I'd leave things as they are in v7 and make the switch to setting the status code as an attribute in v8. This is easy anyway.

ref #10184

Copy link
Contributor

github-actions bot commented Jan 19, 2024

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped) 78.08 KB (+0.26% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 69.28 KB (+0.3% 🔺)
@sentry/browser (incl. Tracing, Replay with Canvas) - Webpack (gzipped) 73.17 KB (+0.3% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 62.9 KB (+0.31% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 33.32 KB (+0.64% 🔺)
@sentry/browser (incl. Feedback) - Webpack (gzipped) 31.28 KB (0%)
@sentry/browser (incl. sendFeedback) - Webpack (gzipped) 31.29 KB (0%)
@sentry/browser - Webpack (gzipped) 22.54 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) - ES6 CDN Bundle (gzipped) 75.81 KB (+0.27% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 67.35 KB (+0.29% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 33.22 KB (+0.64% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped) 24.46 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 212.01 KB (+0.26% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 100.03 KB (+0.55% 🔺)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 73.17 KB (0%)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 36.32 KB (+0.58% 🔺)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 69.69 KB (+0.3% 🔺)
@sentry/react - Webpack (gzipped) 22.58 KB (0%)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 86.33 KB (+0.23% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 50.64 KB (+0.39% 🔺)
@sentry-internal/feedback - Webpack (gzipped) 17.21 KB (0%)

@Lms24 Lms24 force-pushed the lms/feat-core-deprecate-span-setHttpStatus branch from 7a593a7 to b681a47 Compare January 25, 2024 17:01
@Lms24 Lms24 marked this pull request as ready for review January 26, 2024 09:07
@Lms24 Lms24 merged commit 8554dca into develop Jan 29, 2024
@Lms24 Lms24 deleted the lms/feat-core-deprecate-span-setHttpStatus branch January 29, 2024 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants